package com.distortiongames.level27.generation
{
	import flash.utils.Dictionary;
	
	/**
	 * ...
	 * @author Jefferson Wagner
	 */
	public class Phrase
	{
		private var _shade:Shade, _primary:Keyword, _secondary:Keyword, _tertiary:Keyword;
		public var properties:Dictionary;
		public var seed:int;
		
		public function Phrase(shade:Shade, primary:Keyword, secondary:Keyword, tertiary:Keyword)
		{
			this._shade = shade;
			this._primary = primary;
			this._secondary = secondary;
			this._tertiary = tertiary;
			properties = new Dictionary();
			for (var key:Object in shade.properties) {
				properties[key] = shade.properties[key];
			}
			for (key in primary.properties) {
				properties[key] = primary.properties[key];
			}
			for (key in secondary.properties) {
				properties[key] = secondary.properties[key];
			}
			for (key in tertiary.properties) {
				properties[key] = tertiary.properties[key];
			}
			seed = _shade.hashCode() + primary.hashCode() + secondary.hashCode() + tertiary.hashCode();
		}
		
		public function get shade():Shade 
		{
			return _shade;
		}
		
		public function get primary():Keyword
		{
			return _primary;
		}
		
		public function get secondary():Keyword 
		{
			return _secondary;
		}
		
		public function get tertiary():Keyword 
		{
			return _tertiary;
		}
		
		public function toString() : String {
			return shade.name + ": " + primary.name + "/"+secondary.name + "/"+tertiary.name;
		}
	}

}